FROM  python:3.6-slim

ADD sources.list /etc/apt/
RUN apt-get update

RUN apt-get autoremove 

RUN    pip3 install jieba --trusted-host pypi.douban.com -i http://pypi.douban.com/simple
RUN    pip3 install pymongo --trusted-host pypi.douban.com -i http://pypi.douban.com/simple
RUN    pip3 install flask  --trusted-host pypi.douban.com -i http://pypi.douban.com/simple

RUN apt-get install -y --allow-unauthenticated vim

ENV LANG="zh_CN.UTF-8" \
    LANGUAGE="zh_CN.UTF-8"\
    LC_NUMERIC="zh_CN.UTF-8"\
    LC_TIME="zh_CN.UTF-8"\
    LC_MONETARY="zh_CN.UTF-8"\
    LC_PAPER="zh_CN.UTF-8"\
    LC_NAME="zh_CN.UTF-8"\
    LC_ADDRESS="zh_CN.UTF-8"\
    LC_TELEPHONE="zh_CN.UTF-8"\
    LC_MEASUREMENT="zh_CN.UTF-8"\
    LC_IDENTIFICATION="zh_CN.UTF-8"\
    LC_ALL="zh_CN.UTF-8"

COPY locale-gen /usr/local/bin
COPY fasttext /usr/local/bin

ADD i18n.tar.gz /usr/share

RUN locale-gen zh_CN.UTF-8
RUN mkdir "/usr/local/app"
VOLUME ["/usr/local/app"]

WORKDIR "/usr/local/app"

EXPOSE 10023

#ENTRYPOINT ["/usr/local/app/start_server.sh"]


